cc-pocket · Changed files v2 — git-grade diff review
daemon now ships per-file unified diffs · dark theme
SCREEN 01 Mobile · “Files changed” bottom sheet over a dimmed chat · status letters + colored stats
State
9:41
Fix relay reconnect default
the reconnect loop dies after the 3rd retry — can you find why and add a regression test?
The backoff timer lives on the socket’s own scope, which is cancelled when the socket closes. I hoisted it to an app-level scope and touched a handful of files.
Bashgradle :relay:test
Tests pass. 8 files changed — tap to review.
Files changed 8 files · +214 −38
M
App.tsx
src/app
+12 −3×3
A
useDiff.ts
src/hooks
+48
M
WsClient.rs
src/net/relay
+31 −9
A
0007_add_diffs.sql
db/migrations
+42
M
theme.css
src/styles
+6 −6×2
D
legacy_api.py
src/server/api
−120
A
hero@2x.png
assets/images
N
explore.ipynb
analysis/notebooks
+18 −4
Row anatomy
  • Status glyph — 20×20 rounded square, mono bold: A added · M modified · D deleted · N notebook.
  • Middle — filename 14 medium, ellipsized, over the tail of its directory (11 mono muted).
  • Right — mono +N −M, a muted ×3 edit-count when a file was touched more than once. Deleted rows show only −120; image rows show an image glyph.
SCREEN 02 Mobile · full-screen diff viewer Diff / File toggle · shared unified-diff grammar
State
9:41
App.tsx
src/app
+12 −3M
Diff truncated — showing first 200 of 480 KB.
Line-level diffs need a newer daemon.
Run the update command on your computer.
@@ −18,7 +18,9 @@ export function ChangedFiles 7 lines copy
1818import { useState } from 'react'
1919import { Sheet } from './Sheet'
20import { fetchFiles } from './api'
20+import { fetchFiles, fetchDiff } from './api'
21+import { useDiff } from '../hooks/useDiff'
2122
2223export function ChangedFiles({ session }: Props) {
42 unchanged lines
2324 const { data } = useSession(sessionId)
2425 const [tab, setTab] = useState('diff')
@@ −96,4 +104,6 @@ return ( 6 lines copy
96104 <Sheet title="Files changed">
97105 <Summary stat={stat} />
106+ {loading && <DiffSkeleton rows={3} />}
107+ {diff && <UnifiedDiff hunks={diff.hunks} />}
98108 </Sheet>
99109 )
Diff grammar (shared with desktop)
  • Hunk band@@ −64,5 +70,9 @@ in muted mono on a raised full-width band; tap to collapse (collapsed = chevron + “7 lines”).
  • Added rows carry a + and a 12% success tint under readable primary text; removed rows a and a 12% danger tint with slightly dimmed text; context is plain secondary, 3 lines around each hunk.
  • ⋯ separator collapses distant runs (“42 unchanged lines”, tap to expand). A quiet mono line-number gutter stays lighter than the code. Monospace throughout, horizontal scroll, no wrap.
SCREEN 03 Desktop · Changes two-pane browser modal over the two-pane app · same overlay language as ⌘K
State
cc-pocket
Search⌘K
Lidapeng-MBP
Projects
cc-pocket
relay
Sessions
Fix relay reconnect
Add WS reconnect test
Refactor auth module
Settingsv0.5.0
Fix relay reconnect default ± 8
~/code/cc-pocket  ·  ⑂ main  ·  sonnet
YOU
the websocket reconnect dies after the 3rd retry — can you find why and add a regression test?
The backoff timer is scheduled on the socket’s own scope, which is cancelled the moment the socket closes. Hoisting it to an app-level scope fixes it. I touched 8 files.
Bashgradle :relay:test
Tests pass. The reconnect now survives socket-scope cancellation.
Changes8 files · +214 −38
A
useDiff.ts
src/hooks
+48
M
WsClient.rs
src/net/relay
+31 −9
M
App.tsx
src/app
+12 −3
A
0007_add_diffs.sql
db/migrations
+42
M
theme.css
src/styles
+6 −6
D
legacy_api.py
src/server/api
−120
A
hero@2x.png
assets/images
N
explore.ipynb
analysis/notebooks
+18 −4
~/code/cc-pocket/src/app/App.tsx M+12 −3
@@ −18,7 +18,9 @@export function ChangedFiles7 linescopy hunk
1818import { useState } from 'react'
1919import { Sheet } from './Sheet'
20import { fetchFiles } from './api'
20+import { fetchFiles, fetchDiff } from './api'
21+import { useDiff } from '../hooks/useDiff'
2122
2223export function ChangedFiles({ session }: Props) {
42 unchanged lines
2324 const { data } = useSession(sessionId)
2425 const [tab, setTab] = useState('diff')
@@ −96,4 +104,6 @@return (6 linescopy hunk
96104 <Sheet title="Files changed">
97105 <Summary stat={stat} />
106+ {loading && <DiffSkeleton rows={3} />}
107+ {diff && <UnifiedDiff hunks={diff.hunks} />}
98108 </Sheet>
99109 )
↑↓ switch file focus diff⌥←→ collapse/expand hunkesc close
Chat header · new “± 8” entry (left of ⋯)
Fix relay reconnect default ± 8
~/code/cc-pocket  ·  ⑂ main  ·  sonnet